package cn.nucpyh.soft;

public class ReMethod {
    //方法的重写
    private int data ;
    private String things;

    public int getData() {
        return data;
    }

    public void setData(int data) {
        this.data = data;
    }

    public String getThings() {
        return things;
    }

    public void setThings(String things) {
        this.things = things;
    }

    public void fun(){
        System.out.println("动物叫~");
    }
}
//继承
class ReMethod01 extends ReMethod{
    //方法的格式要与父类一致
    public  void fun(){
        final String abc = "abc";
        //final 不可被调用赋值
      //  abc = "abcd";

        //调用父类的方法:
        super.fun();//super调用父类中非私类方法
        System.out.println("汪汪汪~");
    }
}
